Release 10.1A: OpenEdge Development:
Progress 4GL Handbook
Using shorthand syntax for dynamic field and table references
As you might have noticed in the previous section, the syntax for referring to dynamic fields and tables within a temp-table (or dynamic ProDataSet, query, or buffer) is cumbersome. For example, when you want to refer to the CustNum field of the ttCustomer table through a temp-table handle, you must type out this long line of code:
Starting with OpenEdge Release 10.1A, there is an alternative shorthand syntax that you can use that can makes writing dynamic references to fields and tables easier. You can use this shorthand syntax when the field or table name you are referencing is known at compile time:
Where
container-handleis a temp-table, ProDataSet, or buffer handle andnamed-memberis the name of a member of the container. If the container is a temp-table, then thenamed-membermust be a field in the temp-table and the value of that field in the default buffer for the temp-table is returned. If the container is a ProDataSet, then thenamed-membermust be the name of a buffer in the ProDataSet and that buffer’s handle is returned. If the container is a buffer, then thenamed-membermust be a field in the buffer and the value of that field in the buffer is returned.As an example, if the CustNum field is known at compile time, you can instead type the following code to reference the CustNum field of the ttCustomer table through a temp-table handle:
The shorthand syntax uses a double colon (::) for the delimiter between the two character strings to help avoid confusion with variables, text strings, as well as static references to database tables and fields. Table 20–1 describes the rules that determine which type of delimiter to use between two character strings.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |